/*!
 * @file Vector4.cpp
 * @author naoki takeda
 * @version 1.0
 */
#include "StdAfx.h"
#include "NTEngine/Math/Vector4.h"
#include "NTEngine/Math/Vector3.h"

namespace NTEngine {
namespace Math {

Vector4::Vector4( float ax, float ay, float az, float aw )
: x( ax ), y( ay ), z( az ), w( aw ) {
}

Vector4::Vector4( const Vector4& a )
: x( a.x ), y( a.y ), z( a.z ), w( a.w ) {
}

Vector4::Vector4( const Vector3& a )
: x( a.x ), y( a.y ), z( a.z ), w( 1.F ) {
}

void Vector4::operator=( const Vector4& a ) {
	x = a.x;
	y = a.y;
	z = a.z;
	w = a.w;
}

void Vector4::operator=( const Vector3& a ) {
	x = a.x;
	y = a.y;
	z = a.z;
	w = 1.F;
}

float& Vector4::operator[]( int i ) {
	ASSERT( ( i >= 0 ) && ( i < 4 ) );
	return ( &x )[ i ];
}

float Vector4::operator[]( int i ) const {
	ASSERT( ( i >= 0 ) && ( i < 4 ) );
	return ( &x )[ i ];
}

void Vector4::set( float ax, float ay, float az, float aw ) {
	x = ax;
	y = ay;
	z = az;
	w = aw;
}

void Vector4::set( float ax, float ay, float az ) {
	x = ax;
	y = ay;
	z = az;
	w = 1.F;
}

} // namespace Math
} // namespace NTEngine
// EOF